package com.eh.erd.core.controller.admin;

import com.eh.common.result.R;
import com.eh.erd.core.pojo.entity.UserLoginRecord;
import com.eh.erd.core.service.UserLoginRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zhuyuanwei
 * @version 1.0
 * @date 2021/5/24 17:24
 */
@Api(tags = "登录日志管理")
@Slf4j
@RequestMapping("/admin/core/userLoginRecord")
@RestController
public class AdminUserLoginRecordController {

    @Autowired
    UserLoginRecordService userLoginRecordService;

    @ApiOperation("会员登录日志查询")
    @GetMapping("/listTop50/{userId}")
    public R listTop50(@PathVariable @ApiParam(value = "用户Id",required = true) Long userId){

        List<UserLoginRecord> list=userLoginRecordService.listTop50(userId);

        return R.ok().data("list",list);
    }

}



